package com.hph.springcloudstreamkafkademo.consumer;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * kafka消费者监听器（用于spring kafka、spring cloud stream kafka测试）
 * @author HPH
 * @date 2019/7/27
 */
@Component
public class KafkaConsumerListener {

    @KafkaListener(topics = "${kafka.topic}")
    public void onMessage(String message){

        System.out.println("kafka消费监听器："+message);
    }

    @KafkaListener(topics = "${test.kafka.topic}")
    public void myOnMessage(String message){

        System.out.println("这是自定source测试 - kafka消费监听器："+message);
    }
}
